#!/usr/bin/gnuplot

reset

set format x "2^%g"
set format y "%3.f B/s"

set term png

set xlabel "Tamanho do Buffer Cliente 2^x"
set ylabel "Taxa de Transmissao B/s"

##Fazer range global
##Mostrar saturaçao em 256
##Explicar smooth unique


set key top right
set title "Buffer Servidor 1B"
set output "graficos/fsV_bs1.png"
plot [] [0:2000000] "bs1/1M.plot" t "Arquivo de 1MB" smooth unique, "bs1/1M.plot" t "Variacao da Taxa 1MB" w p 1 , "bs1/4M.plot" t "Arquivo de 4MB" smooth unique, "bs1/4M.plot" t "Variacao da Taxa 4MB" w p 3 , "bs1/50M.plot"t "Arquivo de 50MB" smooth unique , "bs1/50M.plot" t "Variacao da Taxa 50MB" w p 5 

set key right center
set title "Buffer Servidor 256B"
set output "graficos/fsV_bs256.png"
plot [] [200000:] "bs256/1M.plot" t "Arquivo de 1MB" smooth unique, "bs256/1M.plot" t "Variacao da Taxa 1MB" w p 1 , "bs256/4M.plot" t "Arquivo de 4MB" smooth unique, "bs256/4M.plot" t "Variacao da Taxa 4MB" w p 3 ,"bs256/50M.plot" t "Arquivo de 50MB" smooth unique, "bs256/50M.plot" t "Variacao da Taxa 50MB" w p 5 

set title "Buffer Servidor 2048"
set output "graficos/fsV_bs2048.png"
plot  "bs2048/1M.plot" t "Arquivo de 1MB" smooth unique, "bs2048/1M.plot" t "Variacao da Taxa 1MB" w p 1,  "bs2048/4M.plot" t "Arquivo de 4MB" smooth unique, "bs2048/4M.plot" t "Variacao da Taxa 4MB" w p 3, "bs2048/50M.plot" t "Arquivo de 50MB" smooth unique, "bs2048/50M.plot" t "Variacao da Taxa 50MB" w p 5

set title "Arquivos de diferentes tamanho para diferentes buffers de servidor"
set output "graficos/fsV_bsV.png"
plot "bs1/1M.plot" smooth unique, "bs1/4M.plot" smooth unique, "bs1/50M.plot" smooth unique , "bs256/1M.plot" smooth unique, "bs256/4M.plot" smooth unique, "bs256/50M.plot" smooth unique ,  "bs2048/1M.plot" smooth unique,"bs2048/4M.plot" smooth unique, "bs2048/50M.plot" smooth unique 

set title "Momento em que a taxa de transmissao eh estabilizada"
set output "graficos/fsV_bsV_zoom.png"
plot [3:16] [10500000:] "bs256/1M.plot" smooth unique, "bs256/4M.plot" smooth unique, "bs256/50M.plot" smooth unique , "bs2048/1M.plot" smooth unique,"bs2048/4M.plot" smooth unique, "bs2048/50M.plot" smooth unique

set title "Estabilidade da taxa de transmissao para arquivos de diferentes tamanhos e variados buffers de servidor"
set key bottom right
set output "graficos/fsV_bsV_estabilidade.png"
plot [4:16] [10800000:11600000] "bs256/1M.plot" smooth unique, "bs256/4M.plot" smooth unique, "bs256/50M.plot" smooth unique , "bs2048/1M.plot" smooth unique, "bs2048/4M.plot" smooth unique, "bs2048/50M.plot" smooth unique


set title "Mostra pontos de media junto com uma linha smooth para buffer 256"
set output "graficos/smoothXmedia_zoom.png"
plot [3:8] [9500000:] "bs256/avg.1M.plot" w p, "bs256/1M.plot" smooth unique , "bs256/avg.4M.plot" w p, "bs256/4M.plot" smooth unique , "bs256/avg.50M.plot" w p, "bs256/50M.plot" smooth unique

set title "Localhost X LAN"
set key left center
set output "graficos/localXlan.png"
plot "bslh1/4M.plot" smooth unique, "bslh1/4M.plot" w p 1 , "bs1/4M.plot" smooth unique , "bs1/4M.plot" w p 3 

set title "Wireless"
set output "graficos/wl.png"
plot  [] [] "bswl65535/1M.plot" smooth unique, "bswl65535/1M.plot" w p 1 , "bswl65535/4M.plot" smooth unique, "bswl65535/4M.plot" w p 3 , "bswl65535/50M.plot" smooth unique, "bswl65535/50M.plot" w p 5
